﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Modeling_Sub_Pages_NewsPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ddlAbout.Items.Add("General");
        ddlAbout.Items.Add("Website Issues");
        ddlAbout.Items.Add("Suggestion");
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        UniversityDatabaseManagerment udm = new UniversityDatabaseManagerment();

        string name = txtName.Text;
        string title = ddlAbout.SelectedValue.ToString();
        string email = txtEmail.Text;
        string content = txtComment.Text;

        if (udm.addNewfeedback(udm.createConnection(), name, title, email, content))
        {
            Response.Redirect("~/LoginMessage.aspx?id=5");
        }
        else
        {
            Response.Redirect("~/ErrorPage.aspx");
        }
    }
}